-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GT-2455 provide a Scarlet.Builder extension method to force the default platform #2173
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2173 +/- ##
==========================================
- Coverage 40.28% 40.23% -0.05%
==========================================
Files 384 388 +4
Lines 5702 5709 +7
Branches 1401 1403 +2
==========================================
Hits 2297 2297
- Misses 3082 3089 +7
Partials 323 323 ☔ View full report in Codecov by Sentry. |
7f5a59e
to
03de060
Compare
@NonNull | ||
@SuppressWarnings("MethodName") | ||
static RuntimePlatform Default() { | ||
return new RuntimePlatform.Default(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RuntimePlatform
is a Kotlin internal class in another library, we can still access it from Java to create the instance we need.
|
||
import androidx.annotation.NonNull; | ||
|
||
class RuntimePlatformInternals { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a package private Java class to hide it from the public API for library consumers
@@ -0,0 +1,3 @@ | |||
package com.tinder.scarlet.internal.utils | |||
|
|||
internal fun defaultPlatform() = RuntimePlatformInternals.Default() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we wrap the package-private java RuntimePlatformInternals.Default()
in an internal Kotlin function, this allows us to access it from other packages in this module without exposing it on the public API
* https://github.com/Tinder/Scarlet/issues/235 | ||
* https://issuetracker.google.com/issues/342419066 | ||
*/ | ||
fun Scarlet.Builder.forceDefaultPlatform() = apply { platform = defaultPlatform() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only new thing exposed on the public API of this module
No description provided.